<!doctype html>
<html>
{include file="head.html"}

<body>
<div class="header" >
    <a href="{$shopadmin}?m=index" class="left-btn" ><span class="iconfont icon-back"></span></a>
    <div class="title">快递员-订单</div>
     <a class="right-btn" href="{$shopadmin}?m=kdyuan_order&a=add"><span class="iconfont icon-write"></span></a>
  </div>
	<style>
    .kdorders .item{margin-bottom:10x; border-bottom:1px solid #eee; padding-bottom:10px; }
	.kdorders .item .pd{padding:10px;}
	.kdorders .item .address{line-height:22px; padding:10px 5px;}
	.kdorders .item .fcontact{line-height:22px; padding:10px 5px;}
	.kdorders .item .product{line-height:22px; padding:10px 5px;}
	.kdorders .item .tool{height:30px; line-height:30px;}
	.kdorders .item .tool a{margin-right:10px; color:#FF6666;}
    </style>
    <div class="main-body">
    	<div class="tabs-border">
        	 
            <a href="{$appshop}?m=kdyuan_order&status=0" class="item">未确认</a>
            <a href="{$appshop}?m=kdyuan_order&status=1" class="item">配送中</a>
            <a href="{$appshop}?m=kdyuan_order&status=2" class="item">已完成</a>
        </div>
        <div class="kdorders">
        
        	{foreach item=c from=$data}
            <div class="item">
            	<div class="pd">
            	<div class="address">
                收货：{$c.address}
                </div>
                <div class="fcontact">发货：{$c.fcontact}</div>
                <div class="product">
                	 
                	{$c.content|nl2br}
                </div>
                <div class="price">费用：￥{$c.money}元</div>
                <div class="tool">
                	{$status_list[$c[status]]}
                    
                </div>
                </div>
            </div>
            {/foreach}
        </div>
    
    </div>
<script>
$(function(){
	$(".Do").on(CLICK,function(){
		var obj=$(this);
		$.post($(this).attr("url"),function(data){
			if(data.error==0){
				 
				obj.parents(".tool").html('接单成功，请尽快配送');
			}else{
				skyToast(data.message);
			}
				
		},"json");
	});
	
	$(".unDo").on(CLICK,function(){
		var obj=$(this);
		if(confirm('确认弃单吗？')){
			$.post($(this).attr("url"),function(data){
				if(data.error==0){
					obj.parents(".tool").html('弃单成功');
				}else{
					skyToast(data.message);
				}
					
			},"json");
		}
	});
	
	$(".Done").on(CLICK,function(){
		var obj=$(this);
		if(confirm('确认配送完成吗？')){
			$.post($(this).attr("url"),function(data){
				if(data.error==0){
					obj.parents(".tool").html('配送完成');
				}else{
					skyToast(data.message);
				}
					
			},"json");
		}
	});
	
});
</script>
</body>
</html>
